SYMBOLS {
    __STACKSIZE__:   type = weak,   value = $0800; # 2k stack
	__DISPATCHERSIZE__: type = weak, value = $2900; # ~12k
	__OVERLAYSIZE__: type = weak, value = $1F00; # ~8k
	__BUFFERSSIZE__: type = weak, value - $0D00;
	__TAPESIZE__: type = weak, value = $00BF;

	__DPLOADADDR__: type = import;
	__CDLOADADDR__: type = import;
}
MEMORY {
    ZP:			start = $0002, size = $001A;
	CPUSTACK:	start = $0100, size = $0100;

    RAM:		file = "",				define = yes,	start = $0800, size = $2300,	fill = no; 
	BUFFER:		file = "",				define = yes,	start = $2B00, size = __BUFFERSSIZE__, fill = no;
	ROM1:		file = "easycli.bin",	define = yes,	start = $8000, size = $2000,			fill = yes, fillval= $ff;
	ROM2:		file = "easycli.bin",	define = yes,	start = $A000, size = $1000,			fill = yes, fillval= $ff;
	ROM3:		file = "easycli.bin",	define = yes,	start = $B000, size = $0700,			fill = yes, fillval= $ff;
	ROM4:		file = "easycli.bin",	define = yes,	start = $B700, size = $0100,			fill = yes, fillval= $ff;
	EAPI:		file = "easycli.bin",	define = yes,	start = $B800, size = $0780,			fill = yes, fillval= $ff;
	ULTIMAX:	file = "easycli.bin",	define = yes,	start = $FF80, size = $007A,			fill = yes, fillval= $ff;
	VECTORS:	file = "easycli.bin",	define = yes,	start = $FFFA, size = $0006,			fill = yes, fillval= $ff;
	EAPIRAM:	file = "",				define = yes,	start = $C000, size = $0300,			fill = yes;
	RAM2:		file = "",				define = yes,	start = $C300, size = $0C00,			fill = yes;
	RAM3:		file = "",				define = yes,	start = $CF00, size = $0100,			fill = yes;
	TAPE:		file = "",				define = yes,	start = $033C, size = $00BF,			fill = yes;
	TAPE2:		file = "",				define = yes,	start = $033C, size = $00BF,			fill = yes;

	CMDLET:		file = "cmd.test",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = __OVERLAYSIZE__, fill = no;

	DPLA:		file = "ovl.dispatcher",define = yes,	start = $8000 - __DISPATCHERSIZE__, size = $0002, fill = no;
	DP:			file = "ovl.dispatcher",define = yes,	start = $8000 - __DISPATCHERSIZE__, size = __DISPATCHERSIZE__, fill = no;
	CDLA:		file = "cmd.cd",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	CD:			file = "cmd.cd",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	DIRLA:		file = "cmd.dir",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	DIR:		file = "cmd.dir",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	MKDIRLA:	file = "cmd.mkdir",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	MKDIR:		file = "cmd.mkdir",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	DELLA:		file = "cmd.del",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	DEL:		file = "cmd.del",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	RMDIRLA:	file = "cmd.rmdir",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	RMDIR:		file = "cmd.rmdir",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	RENLA:		file = "cmd.ren",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	REN:		file = "cmd.ren",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	COPYLA:		file = "cmd.copymove",	define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	COPY:		file = "cmd.copymove",	define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	HELPLA:		file = "cmd.help",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	HELP:		file = "cmd.help",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = $4000 - ($8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__) - 3, fill = no;
	EXECLA:		file = "cmd.exec",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	EXEC:		file = "cmd.exec",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - __TAPESIZE__ - 3, fill = yes, fillval = $ff;
	EXECLO:		file = "cmd.exec",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __TAPESIZE__, size = __TAPESIZE__, fill = no;
	SHOWLA:		file = "cmd.show",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	SHOW:		file = "cmd.show",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	MKIMGLA:	file = "cmd.mkimg",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	MKIMG:		file = "cmd.mkimg",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;
	WRIMGLA:	file = "cmd.wrimg",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__, size = $0005, fill = no;
	WRIMG:		file = "cmd.wrimg",		define = yes,	start = $8000 - __DISPATCHERSIZE__ - __OVERLAYSIZE__ + 3, size = __OVERLAYSIZE__ - 3, fill = no;

	HELPCD:		file = "help.cd",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPDIR:	file = "help.dir",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPMKDIR:	file = "help.mkdir",	define = yes,	start = $4000, size = $1800, fill = no;
	HELPRMDIR:	file = "help.rmdir",	define = yes,	start = $4000, size = $1800, fill = no;
	HELPDEL:	file = "help.del",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPREN:	file = "help.ren",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPPATH:	file = "help.path",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPCOPY:	file = "help.copy",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPMOVE:	file = "help.move",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPHELP:	file = "help.help",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPSHOW:	file = "help.show",		define = yes,	start = $4000, size = $1800, fill = no;
	HELPMKIMG:	file = "help.mkimg",	define = yes,	start = $4000, size = $1800, fill = no;
	HELPWRIMG:	file = "help.wrimg",	define = yes,	start = $4000, size = $1800, fill = no;
}
SEGMENTS {
	ULTIMAX:  load = ULTIMAX,	type = ro;
	VECTORS:  load = VECTORS,	type = ro;
	EAPI:	  load = EAPI,		type = ro, define = yes;
    STARTUP:  load = ROM1,      type = ro;
    LOWCODE:  load = ROM1,      type = ro,                optional = yes;
    INIT:     load = ROM1,      type = ro,  define = yes, optional = yes;
    CODE:     load = ROM1,      type = ro, define = yes; 
	LOADER:	  load = ROM3,		run = RAM2, type = ro, define = yes;
	RUNNER:	  load = ROM3,		run = TAPE, type = ro, define = yes;
	COPYFILE: load = ROM4,		run = RAM3, type = ro, define = yes;
    DATA:     load = ROM1,		run = RAM, type = rw, define = yes;
	BUFFERS:  load = BUFFER,	type = bss, define = yes;
    RODATA:   load = ROM1,      type = ro, define = yes;
    BSS:      load = RAM,		type = bss, define = yes;
	HEAP:	  load = RAM,		type = bss, optional = yes;
    ZEROPAGE: load = ZP,		type = zp,	define = yes;

	DPLA:	  load = DPLA,		type = ro, define = yes;
	DPCODE:	  load = DP,		type = ro, define = yes;

	CMDLET:	  load = CMDLET,	type = ro, define = yes;

	CDLA:	  load = CDLA,		type = ro, define = yes;
	CDCODE:	  load = CD,		type = ro, define = yes;

	DIRECTORYLA:	  load = DIRLA,		type = ro, define = yes;
	DIRECTORYCODE:	  load = DIR,		type = ro, define = yes;

	MKDIRLA:	  load = MKDIRLA,	type = ro, define = yes;
	MKDIRCODE:	  load = MKDIR,		type = ro, define = yes;

	DELLA:		load = DELLA,	type = ro, define = yes;
	DELCODE:	  load = DEL,		type = ro, define = yes;

	RMDIRLA:		load = RMDIRLA,	type = ro, define = yes;
	RMDIRCODE:	  load = RMDIR,		type = ro, define = yes;

	RENLA:		load = RENLA,	type = ro, define = yes;
	RENCODE:	  load = REN,		type = ro, define = yes;

	COPYLA:		load = COPYLA,		type = ro, define = yes;
	COPYCODE:	load = COPY,		type = ro, define = yes;

	HELPLA:		load = HELPLA,	type = ro, define = yes;
	HELPCODE:	load = HELP,		type = ro, define = yes;

	EXECLA:		load = EXECLA,		type = ro, define = yes;
	EXECCODE:	load = EXEC,		type = ro, define = yes;
	EXECLOCODE:	load = EXECLO,	run = TAPE2, type = ro, define = yes;

	SHOWLA:		load = SHOWLA,		type = ro, define = yes;
	SHOWCODE:	load = SHOW,		type = ro, define = yes;

	MKIMGLA:	load = MKIMGLA,		type = ro, define = yes;
	MKIMGCODE:	load = MKIMG,		type = ro, define = yes;

	WRIMGLA:	load = WRIMGLA,		type = ro, define = yes;
	WRIMGCODE:	load = WRIMG,		type = ro, define = yes;

	HELPCD:		load = HELPCD,	type = ro, define = yes;
	HELPDIR:	load = HELPDIR,	type = ro, define = yes;
	HELPMKDIR:	load = HELPMKDIR,	type = ro, define = yes;
	HELPRMDIR:	load = HELPRMDIR,	type = ro, define = yes;
	HELPDEL:	load = HELPDEL,	type = ro, define = yes;
	HELPREN:	load = HELPREN,	type = ro, define = yes;
	HELPPATH:	load = HELPPATH,	type = ro, define = yes;
	HELPCOPY:	load = HELPCOPY,	type = ro, define = yes;
	HELPMOVE:	load = HELPMOVE,	type = ro, define = yes;
	HELPHELP:	load = HELPHELP,	type = ro, define = yes;
	HELPSHOW:	load = HELPSHOW,	type = ro, define = yes;
	HELPMKIMG:	load = HELPMKIMG,	type = ro, define = yes;
	HELPWRIMG:	load = HELPWRIMG,	type = ro, define = yes;
}
FEATURES {
    CONDES: segment = INIT,
	    type    = constructor,
	    label   = __CONSTRUCTOR_TABLE__,
	    count   = __CONSTRUCTOR_COUNT__;
    CONDES: segment = RODATA,
	    type    = destructor,
	    label   = __DESTRUCTOR_TABLE__,
	    count   = __DESTRUCTOR_COUNT__;
    CONDES: segment = RODATA,
	    type    = interruptor,
	    label   = __INTERRUPTOR_TABLE__,
	    count   = __INTERRUPTOR_COUNT__;
}
